<template>
  <view class="vip-dialog-mask" v-if="visible" @click="close">
    <view class="vip-dialog-container" @click.stop>
      <view class="vip-dialog-header">
        <text class="title">游戏陪玩VIP</text>
        <text class="close" @click="close">×</text>
      </view>
      
      <view class="vip-dialog-content">
        <view class="game-icons">
          <image class="game-icon" src="/static/wzry-icon.png" mode="aspectFit"></image>
          <image class="game-icon" src="/static/cj-icon.png" mode="aspectFit"></image>
        </view>
        
        <view class="comparison-section">
          <view class="comparison-header">
            <text class="comparison-title">陪玩特权对比</text>
          </view>
          <view class="comparison-row">
            <text class="comparison-label">每日查看陪玩小姐姐次数</text>
            <view class="comparison-values">
              <text class="comparison-value non-vip">3次</text>
              <text class="comparison-value vip">无限</text>
            </view>
          </view>
          <view class="comparison-row">
            <text class="comparison-label">专属游戏陪玩</text>
            <view class="comparison-values">
              <text class="comparison-value non-vip">×</text>
              <text class="comparison-value vip">✓</text>
            </view>
          </view>
          <view class="divider"></view>
        </view>
        
        <view class="benefits-container">
          <view class="benefits-column">
            <text class="column-title">普通玩家</text>
            <view class="benefits">
              <view class="benefit-item">
                <text class="icon non-vip-icon">×</text>
                <text class="text non-vip-text">王者荣耀专属陪玩</text>
              </view>
              <view class="benefit-item">
                <text class="icon non-vip-icon">×</text>
                <text class="text non-vip-text">吃鸡高级陪玩</text>
              </view>
              <view class="benefit-item">
                <text class="icon non-vip-icon">×</text>
                <text class="text non-vip-text">语音连麦指导</text>
              </view>
              <view class="benefit-item">
                <text class="icon non-vip-icon">×</text>
                <text class="text non-vip-text">战绩提升保障</text>
              </view>
              <view class="benefit-item">
                <text class="icon non-vip-icon">×</text>
                <text class="text non-vip-text">优先匹配小姐姐</text>
              </view>
            </view>
          </view>
          
          <view class="benefits-column">
            <text class="column-title">VIP玩家</text>
            <view class="benefits">
              <view class="benefit-item">
                <text class="icon">✓</text>
                <text class="text">王者荣耀国服陪玩</text>
              </view>
              <view class="benefit-item">
                <text class="icon">✓</text>
                <text class="text">吃鸡王牌陪玩</text>
              </view>
              <view class="benefit-item">
                <text class="icon">✓</text>
                <text class="text">全程语音指导</text>
              </view>
              <view class="benefit-item">
                <text class="icon">✓</text>
                <text class="text">段位保障服务</text>
              </view>
              <view class="benefit-item">
                <text class="icon">✓</text>
                <text class="text">优先匹配心仪陪玩</text>
              </view>
            </view>
          </view>
        </view>
      </view>
      
      <view class="vip-dialog-footer">
        <view class="price">¥{{ price }}<text class="month">/小时</text></view>
        <button class="pay-button" @click="handlePay">立即预约陪玩</button>
      </view>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  },
  price: {
    type: Number,
    default: 68
  }
})

const emit = defineEmits(['update:visible', 'pay'])

const close = () => {
  emit('update:visible', false)
}

const handlePay = () => {
  emit('pay')
  close()
}
</script>

<style scoped>
.vip-dialog-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.vip-dialog-container {
  width: 85%;
  max-width: 650rpx;
  background-color: #fff;
  border-radius: 20rpx;
  overflow: hidden;
  box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.2);
}

.vip-dialog-header {
  padding: 30rpx;
  background: linear-gradient(to right, #FF6B81, #FF4757);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vip-dialog-header .title {
  font-size: 38rpx;
  font-weight: bold;
}

.vip-dialog-header .close {
  font-size: 50rpx;
  line-height: 1;
}

.vip-dialog-content {
  padding: 30rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-icons {
  display: flex;
  justify-content: center;
  margin-bottom: 30rpx;
  gap: 40rpx;
}

.game-icon {
  width: 100rpx;
  height: 100rpx;
  border-radius: 50%;
  box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.1);
}

.comparison-section {
  width: 100%;
  margin-bottom: 30rpx;
}

.comparison-header {
  margin-bottom: 20rpx;
}

.comparison-title {
  font-size: 34rpx;
  font-weight: bold;
  color: #333;
  text-align: center;
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15rpx;
}

.comparison-label {
  font-size: 28rpx;
  color: #666;
  flex: 1;
}

.comparison-values {
  display: flex;
  width: 200rpx;
}

.comparison-value {
  flex: 1;
  text-align: center;
  font-size: 28rpx;
  padding: 5rpx 10rpx;
  border-radius: 8rpx;
}

.comparison-value.non-vip {
  background-color: #f5f5f5;
  color: #999;
}

.comparison-value.vip {
  background-color: #FFECEC;
  color: #FF4757;
  font-weight: bold;
}

.divider {
  height: 1rpx;
  background-color: #f0f0f0;
  margin: 20rpx 0;
}

.benefits-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 20rpx;
  gap: 20rpx;
}

.benefits-column {
  width: 48%;
  background: #fafafa;
  border-radius: 12rpx;
  padding: 15rpx;
}

.column-title {
  display: block;
  text-align: center;
  font-size: 30rpx;
  font-weight: bold;
  margin-bottom: 15rpx;
  padding-bottom: 10rpx;
  border-bottom: 1px solid #f0f0f0;
}

.benefits-column:first-child .column-title {
  color: #999;
}

.benefits-column:last-child .column-title {
  color: #FF4757;
}

.benefits {
  width: 100%;
}

.benefit-item {
  display: flex;
  align-items: center;
  padding: 15rpx 0;
  border-bottom: 1rpx solid #f0f0f0;
}

.benefit-item .icon {
  color: #FF4757;
  margin-right: 15rpx;
  font-weight: bold;
  font-size: 32rpx;
}

.benefit-item .non-vip-icon {
  color: #ccc;
}

.benefit-item .text {
  color: #333;
  font-size: 28rpx;
  flex: 1;
}

.benefit-item .non-vip-text {
  color: #999;
}

.vip-dialog-footer {
  padding: 30rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1rpx solid #f0f0f0;
  background: #fafafa;
}

.price {
  color: #FF4757;
  font-size: 48rpx;
  font-weight: bold;
}

.price .month {
  font-size: 24rpx;
  color: #999;
  margin-left: 5rpx;
}

.pay-button {
  background: linear-gradient(to right, #FF6B81, #FF4757);
  color: white;
  border: none;
  border-radius: 50rpx;
  padding: 0 50rpx;
  height: 90rpx;
  line-height: 90rpx;
  font-size: 32rpx;
  font-weight: bold;
  box-shadow: 0 5rpx 15rpx rgba(255, 107, 129, 0.3);
}

.pay-button::after {
  border: none;
}
</style>